/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. 
 */
package com.icinfo.cloud.provider.punish.ucase.casemain.controller;

import com.icinfo.cloud.provider.common.constant.Constant;
import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseDocumentModifyOfCaseRegisterSaveDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseDocumentModifyOfCaseSourceSaveDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseDocumentModifyRecordQueryDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.dto.CaseDocumentModifyRecordSaveDto;
import com.icinfo.cloud.provider.punish.ucase.casemain.service.ICaseDocumentModifyRecordService;
import com.icinfo.cloud.provider.punish.ucase.casemain.vo.CaseDocumentModifyRecordVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 描述: 文书修改记录表 case_document_modify_record 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2023年01月06日
 */
@RestController
@RequestMapping("/punish/ucase/case/main/document/modify")
public class CaseDocumentModifyRecordController extends BaseController {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseDocumentModifyRecordController.class);

    @Resource
    private ICaseDocumentModifyRecordService caseDocumentModifyRecordService;

    /**
     * 描述： 保存立案审批表文书修改记录
     *
     * @author: zhengqiang
     * @date: 2023/1/7
     * @param: caseDocumentModifyRecordSaveDto
     * @return {@link Result}
     **/
    @PostMapping("/saveCaseDocumentModifyOfCaseRegister")
    public Result saveCaseDocumentModifyOfCaseRegister(@RequestBody @Validated CaseDocumentModifyOfCaseRegisterSaveDto caseDocumentModifyOfCaseRegisterSaveDto) {
        return caseDocumentModifyRecordService.saveCaseDocumentModifyOfCaseRegister(caseDocumentModifyOfCaseRegisterSaveDto);
    }

    /**
     * 描述： 保存通用文书修改记录
     *
     * @author: zhengqiang
     * @date: 2023/1/7
     * @param: caseDocumentModifyRecordSaveDto
     * @return {@link Result}
     **/
    @PostMapping("/saveCaseDocumentModifyRecord")
    public Result saveCaseDocumentModifyRecord(@RequestBody @Validated CaseDocumentModifyRecordSaveDto caseDocumentModifyRecordSaveDto) {
        return caseDocumentModifyRecordService.saveCaseDocumentModifyRecord(caseDocumentModifyRecordSaveDto);
    }

    /**
     * 【V1.11.2】描述： 保存案件来源登记表文书修改记录
     *
     * @author: zhengqiang
     * @date: 2023/3/17
     * @param: modifyOfCaseSourceRegisterSaveDto
     * @return {@link Result}
     **/
    @PostMapping("/saveCaseSourceDocumentModifyRecord")
    public Result saveCaseSourceDocumentModifyRecord(@RequestBody @Validated CaseDocumentModifyOfCaseSourceSaveDto modifyOfCaseSourceRegisterSaveDto) {
        return caseDocumentModifyRecordService.saveCaseSourceDocumentModifyRecord(modifyOfCaseSourceRegisterSaveDto);
    }


    /**
     * 描述： 查看文书修改记录
     *
     * @author: zhengqiang
     * @date: 2023/1/7
     * @param: caseDocumentModifyRecordQueryDto
     * @return {@link Result< List< CaseDocumentModifyRecordVo>>}
     **/
    @PostMapping("/getCaseDocumentModifyRecordByCondition")
    public Result<List<CaseDocumentModifyRecordVo>> getCaseDocumentModifyRecordByCondition(@RequestBody @Validated CaseDocumentModifyRecordQueryDto caseDocumentModifyRecordQueryDto) {
        List<CaseDocumentModifyRecordVo> caseDocumentModifyRecordList = caseDocumentModifyRecordService.getCaseDocumentModifyRecordByCondition(caseDocumentModifyRecordQueryDto);
        return Result.success(caseDocumentModifyRecordList);
    }

    /**
     * 描述： 查看文书修改记录(正常完结流程)
     *
     * @author: zhengqiang
     * @date: 2023/2/27
     * @param: caseDocumentModifyRecordQueryDto
     * @return {@link Result< List< CaseDocumentModifyRecordVo>>}
     **/
    @PostMapping("/getNormalCaseDocumentModifyRecordList")
    public Result<List<CaseDocumentModifyRecordVo>> getNormalCaseDocumentModifyRecordList(@RequestBody @Validated CaseDocumentModifyRecordQueryDto caseDocumentModifyRecordQueryDto) {
        caseDocumentModifyRecordQueryDto.setIsQueryNormal(Constant.STRING_1);
        List<CaseDocumentModifyRecordVo> caseDocumentModifyRecordList = caseDocumentModifyRecordService.getNormalCaseDocumentModifyRecordList(caseDocumentModifyRecordQueryDto);
        return Result.success(caseDocumentModifyRecordList);
    }

}